<!doctype html>



  


<html class="theme-next mist use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>



<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />












  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.0" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="ansible,vagrant,autoit,virtualbox,python,pip,zookeeper,storm,kafka," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.0" />






<meta name="description" content="概述现代系统运行于集群环境之上已经是基本需求，而系统的开发环境往往局限于单机。为了搭建集群开发环境，一种方式是创建多个虚拟机，一种是采用Docker容器。通过手动配置构建的集群环境费时费力，一旦系统重装或机器切换，又需要耗费大量的时间来重新搭建。本文采用Vagrant+VirtualBox+Ansible通过简单的步骤在单机系统上自动化构建集群开发环境。">
<meta property="og:type" content="article">
<meta property="og:title" content="Vagrant+VirtualBox+Ansible在Windows系统上自动化搭建集群开发环境">
<meta property="og:url" content="http://chrisrc.me/2015/11/15/autoit-cluster-dev-on-vagrant-with-ansible/index.html">
<meta property="og:site_name" content="山中，山外与俯瞰">
<meta property="og:description" content="概述现代系统运行于集群环境之上已经是基本需求，而系统的开发环境往往局限于单机。为了搭建集群开发环境，一种方式是创建多个虚拟机，一种是采用Docker容器。通过手动配置构建的集群环境费时费力，一旦系统重装或机器切换，又需要耗费大量的时间来重新搭建。本文采用Vagrant+VirtualBox+Ansible通过简单的步骤在单机系统上自动化构建集群开发环境。">
<meta property="og:image" content="http://chrisrc.me/images/ansible_cluster_windows_path.png">
<meta property="og:image" content="http://chrisrc.me/images/ansible_cluster_vagrant_box.png">
<meta property="og:image" content="http://chrisrc.me/images/ansible_cluster_vagrant_cluster_vms.png">
<meta property="og:image" content="http://chrisrc.me/images/ansible_cluster_vagrant_cluster_deploy.png">
<meta property="og:updated_time" content="2016-12-17T07:29:29.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Vagrant+VirtualBox+Ansible在Windows系统上自动化搭建集群开发环境">
<meta name="twitter:description" content="概述现代系统运行于集群环境之上已经是基本需求，而系统的开发环境往往局限于单机。为了搭建集群开发环境，一种方式是创建多个虚拟机，一种是采用Docker容器。通过手动配置构建的集群环境费时费力，一旦系统重装或机器切换，又需要耗费大量的时间来重新搭建。本文采用Vagrant+VirtualBox+Ansible通过简单的步骤在单机系统上自动化构建集群开发环境。">
<meta name="twitter:image" content="http://chrisrc.me/images/ansible_cluster_windows_path.png">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Mist',
    sidebar: {"position":"left","display":"post"},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://chrisrc.me/2015/11/15/autoit-cluster-dev-on-vagrant-with-ansible/"/>





  <title> Vagrant+VirtualBox+Ansible在Windows系统上自动化搭建集群开发环境 | 山中，山外与俯瞰 </title>
</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  










  
  
    
  

  <div class="container one-collumn sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-meta ">
  

  <div class="custom-logo-site-title">
    <a href="/"  class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <span class="site-title">山中，山外与俯瞰</span>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>
  <p class="site-subtitle">一次永不停止的探索之旅</p>
</div>

<div class="site-nav-toggle">
  <button>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
    <span class="btn-bar"></span>
  </button>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-dcos">
          <a href="/dcos" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-book"></i> <br />
            
            DC/OS
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      

      
        <li class="menu-item menu-item-search">
          
            <a href="javascript:;" class="st-search-show-outputs">
          
            
              <i class="menu-item-icon fa fa-search fa-fw"></i> <br />
            
            搜索
          </a>
        </li>
      
    </ul>
  

  
    <div class="site-search">
      
  <form class="site-search-form">
  <input type="text" id="st-search-input" class="st-search-input st-default-search-input" />
</form>

<script type="text/javascript">
  (function(w,d,t,u,n,s,e){w['SwiftypeObject']=n;w[n]=w[n]||function(){
    (w[n].q=w[n].q||[]).push(arguments);};s=d.createElement(t);
    e=d.getElementsByTagName(t)[0];s.async=1;s.src=u;e.parentNode.insertBefore(s,e);
  })(window,document,'script','//s.swiftypecdn.com/install/v2/st.js','_st');

  _st('install', 'R9GcmhBwxpsAGLNCsquZ','2.0.0');
</script>



    </div>
  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
  <link itemprop="mainEntityOfPage" href="http://chrisrc.me/2015/11/15/autoit-cluster-dev-on-vagrant-with-ansible/">

  <span style="display:none" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <meta itemprop="name" content="chrisrc">
    <meta itemprop="description" content="">
    <meta itemprop="image" content="/images/avatar.gif">
  </span>

  <span style="display:none" itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
    <meta itemprop="name" content="山中，山外与俯瞰">
    <span style="display:none" itemprop="logo" itemscope itemtype="http://schema.org/ImageObject">
      <img style="display:none;" itemprop="url image" alt="山中，山外与俯瞰" src="">
    </span>
  </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">
            
            
              
                Vagrant+VirtualBox+Ansible在Windows系统上自动化搭建集群开发环境
              
            
          </h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>
              <time title="Post created" itemprop="dateCreated datePublished" datetime="2015-11-15T13:10:21+08:00">
                2015-11-15
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
              <span class="post-meta-divider">|</span>
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/IT自动化/" itemprop="url" rel="index">
                    <span itemprop="name">IT自动化</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
              <span class="post-comments-count">
                <span class="post-meta-divider">|</span>
                <a href="/2015/11/15/autoit-cluster-dev-on-vagrant-with-ansible/#comments" itemprop="discussionUrl">
                  <span class="post-comments-count ds-thread-count" data-thread-key="2015/11/15/autoit-cluster-dev-on-vagrant-with-ansible/" itemprop="commentCount"></span>
                </a>
              </span>
            
          

          

          
          

          

          

        </div>
      </header>
    


    <div class="post-body" itemprop="articleBody">

      
      

      
        <h2 id="概述"><a href="#概述" class="headerlink" title="概述"></a>概述</h2><p>现代系统运行于集群环境之上已经是基本需求，而系统的开发环境往往局限于单机。为了搭建集群开发环境，一种方式是创建多个虚拟机，一种是采用Docker容器。<br>通过手动配置构建的集群环境费时费力，一旦系统重装或机器切换，又需要耗费大量的时间来重新搭建。本文采用Vagrant+VirtualBox+Ansible通过简单的步骤<br>在单机系统上自动化构建集群开发环境。</p>
<a id="more"></a>
<p>说明：集群开发最合适的系统环境还是Linux和Mac，在Windows上也可以，但受限于Ansible目前不能用Windows系统作为控制机，所以在Windows系统上只能安装一个额外<br>的虚拟机。</p>
<h2 id="Windows系统软件需求"><a href="#Windows系统软件需求" class="headerlink" title="Windows系统软件需求"></a>Windows系统软件需求</h2><p>在Windows系统（测试环境为Windows 10）上，需要安装如下软件：</p>
<ul>
<li>Git客户端(MysysGit/TortoiseGit/SmartGit)</li>
<li>Vagrant 1.7.4</li>
<li>VirtualBox 5.0.10</li>
</ul>
<h3 id="环境变量配置"><a href="#环境变量配置" class="headerlink" title="环境变量配置"></a>环境变量配置</h3><ol>
<li>安装完Vagrant后，将vagrant程序所在目录（本例<code>C:\\HashiCorp\\Vagrant\\bin</code>）添加到系统<code>PATH</code>环境变量。</li>
<li>安装完VirtualBox后，将virtualbox程序所在目录（本例<code>C:\Program Files\Oracle\VirtualBox</code>）添加到系统<code>PATH</code>环境变量。</li>
</ol>
<p><img src="/images/ansible_cluster_windows_path.png" alt="Vagrant and VirtualBox Windows Path"></p>
<h2 id="集群环境建设目标"><a href="#集群环境建设目标" class="headerlink" title="集群环境建设目标"></a>集群环境建设目标</h2><p>在Windows主机上自动构建4个虚拟机，分别做如下用途：</p>
<ul>
<li>controller 用于执行集群自动构建脚本，在其它三个节点上部署集群环境。</li>
<li>node-1 用作zookeeper服务，storm nimbus节点（其他服务可以根据需要扩展）</li>
<li>node-2 用作zk服务，storm supervisor节点</li>
<li>node-3 用作zk服务，storm supervisor节点</li>
</ul>
<p><strong>说明：</strong></p>
<ul>
<li>因为Windows系统不支持Ansible作为控制机，所以需要一个Linux虚拟机作为控制机，执行ansible playbook脚本。Linux和Mac上可以省略此步骤。</li>
<li>集群节点的数量可以根据需要在Vagrantfile中动态添加和配置。</li>
</ul>
<h2 id="集群搭建过程"><a href="#集群搭建过程" class="headerlink" title="集群搭建过程"></a>集群搭建过程</h2><h3 id="配置Vagrant-Box"><a href="#配置Vagrant-Box" class="headerlink" title="配置Vagrant Box"></a>配置Vagrant Box</h3><p>因Vagrant官方基础盒子仓库下载虚拟机基础盒子非常缓慢（墙？），所以从<a href="http://www.vagrantbox.es/" target="_blank" rel="external">Vagrantbox.es</a>手动下载盒子，然后添加到Vagrant的基础盒子<br>列表。本例采用<a href="https://github.com/CommanderK5/packer-centos-template/releases/download/0.6.7/vagrant-centos-6.7.box" target="_blank" rel="external">CentOS 6.7 x64</a>。</p>
<p>具体步骤如下：  </p>
<ol>
<li>下载上述链接中的基础盒子文件到本地(例：<code>D:\Downloads\centos-6.7-x86_64.box</code>)</li>
<li><p>执行下述命令将盒子文件添加到Vagrant基础BOX列表：  </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vagrant box add centos-6.7-x86_64 file:///D:/Downloads/vagrant-centos-6.7.box</div></pre></td></tr></table></figure>
</li>
<li><p>在命令行执行下述命令检查盒子是否正确添加：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vagrant box list</div></pre></td></tr></table></figure>
</li>
</ol>
<p><img src="/images/ansible_cluster_vagrant_box.png" alt="Vagrant Box"></p>
<h3 id="构建自动部署控制机"><a href="#构建自动部署控制机" class="headerlink" title="构建自动部署控制机"></a>构建自动部署控制机</h3><p><strong>说明：此步骤仅限于Windows系统，本文其他步骤可在Linux及Mac系统重用</strong></p>
<p>以<code>D:\Work</code>为工作目录，在此目录下按下述步骤构建Ansible部署控制机：  </p>
<ol>
<li><p>执行下述命令，初始化Vagrantfile文件：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vagrant init centos-6.7-x86_64</div></pre></td></tr></table></figure>
</li>
<li><p>修改<code>Vagrantfile</code>文件，配置控制机的IP地址（192.168.5.99）：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">Vagrant.configure(2) do |config|</div><div class="line">  config.vm.box = &quot;centos-6.7-x86_64&quot;</div><div class="line">  config.vm.network &quot;private_network&quot;, ip: &quot;192.168.5.99&quot;</div><div class="line">end</div></pre></td></tr></table></figure>
</li>
<li><p>执行<code>vagrant up</code>命令，启动控制机。</p>
</li>
<li><p>执行<code>vagrant ssh</code>登录控制机。</p>
</li>
<li><p>执行下述命令，安装EPEL REPO，安装<code>Ansible</code>环境所需的<code>Python及Pip</code>并下载<code>ansible-cluster-roles</code>：  </p>
 <figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div></pre></td><td class="code"><pre><div class="line">sudo rpm -ivh https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm</div><div class="line">sudo yum -y install git vim ansible</div><div class="line">git clone https://github.com/christtrc/ansible-cluster-roles.git</div></pre></td></tr></table></figure>
</li>
<li><p><strong>删除<code>~/ansible-cluster-roles/ansible.cfg</code>文件</strong></p>
</li>
<li>执行<code>exit</code>退出虚拟机，继续下述步骤。</li>
</ol>
<h3 id="准备集群环境"><a href="#准备集群环境" class="headerlink" title="准备集群环境"></a>准备集群环境</h3><ul>
<li><strong>启动三个虚拟机</strong></li>
</ul>
<p>从Github上克隆<a href="https://github.com/christtrc/ansible-cluster-roles.git" target="_blank" rel="external">ansible-cluster-roles</a>工程，到<code>D:\Work</code>目录下：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">cd D:\Work</div><div class="line">git clone https://github.com/christtrc/ansible-cluster-roles.git</div><div class="line">cd ansible-cluster-roles</div><div class="line">vagrant up  #注意，执行此命令前，应根据下面的描述调整Vagrantfile的配置</div></pre></td></tr></table></figure></p>
<p><strong>配置：由于<code>ansible-cluster-roles</code>工程里Vagrantfile的Box定义（chef/centos-6.6）在Vagrant官方Box列表中已不存在，请根据前述box定义<br>对Vagrantfile进行修改，替换为<code>centos-6.7-x86_64</code>或自己的box名称。</strong></p>
<p>执行结果如下图所示：</p>
<p><img src="/images/ansible_cluster_vagrant_cluster_vms.png" alt="Vagrant cluster vms"></p>
<p>此时，<code>node-1(192.168.5.100), node-2(192.168.5.101), node-3(192.168.5.102)</code>三个虚拟机已经启动并就绪，继续下一节操作。</p>
<h3 id="部署zookeeper-storm等集群"><a href="#部署zookeeper-storm等集群" class="headerlink" title="部署zookeeper/storm等集群"></a>部署zookeeper/storm等集群</h3><p><strong>说明：下述步骤是受限于Windows当前不支持Ansible的解决方案</strong></p>
<p>回到<code>D:\Work</code>目录下，执行下面的命令，在<code>node-1, node-2, node-3</code>三个虚拟机上自动部署<code>zookeeper</code>，<code>Storm</code>等集群环境。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">vagrant up #启动Ansible控制机（192.168.5.99）</div><div class="line">vagrant ssh #进入Ansible控制机</div><div class="line"></div><div class="line">cd ~/ansible-cluster-roles</div></pre></td></tr></table></figure>
<p>执行下面的命令，构建<code>node-1, node-2, node-3</code>三个虚拟机上的集群。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">ansible-playbook -i vagrant vagrant.yml</div></pre></td></tr></table></figure>
<p>根据提示，连续三次输入<code>node-1, node-2, node-3</code>三个节点对应的密码(<code>vagrant</code>)。部署将自动进行。</p>
<p><img src="/images/ansible_cluster_vagrant_cluster_deploy.png" alt="Vagrant cluster deploy"></p>
<h2 id="验证集群可用性"><a href="#验证集群可用性" class="headerlink" title="验证集群可用性"></a>验证集群可用性</h2><h3 id="验证Zookeeper的集群可用性"><a href="#验证Zookeeper的集群可用性" class="headerlink" title="验证Zookeeper的集群可用性"></a>验证Zookeeper的集群可用性</h3><ol>
<li><p>登录到一台集群节点 <code>node-1</code></p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vagrant ssh node-1</div></pre></td></tr></table></figure>
</li>
<li><p>通过命令行程序 <code>zkCli.sh</code> 连接到Zookeeper</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">vagrant@node-1:~$ cd /opt/zookeeper-3.4.6/bin/</div><div class="line">vagrant@node-1:/opt/zookeeper-3.4.6/bin$ ./zkCli.sh -server localhost:2181</div></pre></td></tr></table></figure>
</li>
<li><p>在Zookeeper控制台创建一个znode</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">[zk: localhost:2181(CONNECTED) 3] create /zk_test my_data</div><div class="line">Created /zk_test</div></pre></td></tr></table></figure>
</li>
<li><p>退出控制台，连接到<code>node-2</code> (运行于<code>192.168.5.101</code>)</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vagrant@node-1:/opt/zookeeper-3.4.6/bin$ ./zkCli.sh -server 192.168.5.101:2181</div></pre></td></tr></table></figure>
</li>
<li><p>检查znode <code>zk_test</code> 是否在 <code>node-2</code>上可见。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">[zk: 192.168.5.101:2181(CONNECTED) 0] ls /</div><div class="line">[zookeeper, zk_test]</div><div class="line">[zk: 192.168.5.101:2181(CONNECTED) 1] get /zk_test</div><div class="line">my_data</div></pre></td></tr></table></figure>
</li>
</ol>
<h3 id="验证Storm集群的可用性"><a href="#验证Storm集群的可用性" class="headerlink" title="验证Storm集群的可用性"></a>验证Storm集群的可用性</h3><p><strong>TBD</strong></p>
<h3 id="验证Kafka集群的可用性"><a href="#验证Kafka集群的可用性" class="headerlink" title="验证Kafka集群的可用性"></a>验证Kafka集群的可用性</h3><p><strong>TBD</strong></p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>


    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/ansible/" rel="tag"># ansible</a>
          
            <a href="/tags/vagrant/" rel="tag"># vagrant</a>
          
            <a href="/tags/autoit/" rel="tag"># autoit</a>
          
            <a href="/tags/virtualbox/" rel="tag"># virtualbox</a>
          
            <a href="/tags/python/" rel="tag"># python</a>
          
            <a href="/tags/pip/" rel="tag"># pip</a>
          
            <a href="/tags/zookeeper/" rel="tag"># zookeeper</a>
          
            <a href="/tags/storm/" rel="tag"># storm</a>
          
            <a href="/tags/kafka/" rel="tag"># kafka</a>
          
        </div>
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2015/10/18/csharp-with-java/" rel="next" title="C#模拟浏览器并与JAVA交互">
                <i class="fa fa-chevron-left"></i> C#模拟浏览器并与JAVA交互
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2015/11/26/linux-supervisor-tips/" rel="prev" title="Supervisord进程管理注记">
                Supervisord进程管理注记 <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
        <div class="ds-share flat" data-thread-key="2015/11/15/autoit-cluster-dev-on-vagrant-with-ansible/"
     data-title="Vagrant+VirtualBox+Ansible在Windows系统上自动化搭建集群开发环境"
     data-content=""
     data-url="http://chrisrc.me/2015/11/15/autoit-cluster-dev-on-vagrant-with-ansible/">
  <div class="ds-share-inline">
    <ul  class="ds-share-icons-16">

      <li data-toggle="ds-share-icons-more"><a class="ds-more" href="javascript:void(0);">分享到：</a></li>
      <li><a class="ds-weibo" href="javascript:void(0);" data-service="weibo">微博</a></li>
      <li><a class="ds-qzone" href="javascript:void(0);" data-service="qzone">QQ空间</a></li>
      <li><a class="ds-qqt" href="javascript:void(0);" data-service="qqt">腾讯微博</a></li>
      <li><a class="ds-wechat" href="javascript:void(0);" data-service="wechat">微信</a></li>

    </ul>
    <div class="ds-share-icons-more">
    </div>
  </div>
</div>
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
      <div class="ds-thread" data-thread-key="2015/11/15/autoit-cluster-dev-on-vagrant-with-ansible/"
           data-title="Vagrant+VirtualBox+Ansible在Windows系统上自动化搭建集群开发环境" data-url="http://chrisrc.me/2015/11/15/autoit-cluster-dev-on-vagrant-with-ansible/">
      </div>
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/avatar.gif"
               alt="chrisrc" />
          <p class="site-author-name" itemprop="name">chrisrc</p>
          <p class="site-description motion-element" itemprop="description"></p>
        </div>
        <nav class="site-state motion-element">
          <div class="site-state-item site-state-posts">
            <a href="/archives">
              <span class="site-state-item-count">69</span>
              <span class="site-state-item-name">日志</span>
            </a>
          </div>

          
            <div class="site-state-item site-state-categories">
              <a href="/categories">
                <span class="site-state-item-count">21</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            <div class="site-state-item site-state-tags">
              <a href="/tags">
                <span class="site-state-item-count">162</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/christtrc" target="_blank" title="GitHub">
                  
                    <i class="fa fa-fw fa-github"></i>
                  
                  GitHub
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://twitter.com/chrisrc" target="_blank" title="Twitter">
                  
                    <i class="fa fa-fw fa-twitter"></i>
                  
                  Twitter
                </a>
              </span>
            
          
        </div>

        
        
          <div class="cc-license motion-element" itemprop="license">
            <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/" class="cc-opacity" target="_blank">
              <img src="/images/cc-by-nc-sa.svg" alt="Creative Commons" />
            </a>
          </div>
        

        
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#概述"><span class="nav-number">1.</span> <span class="nav-text">概述</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Windows系统软件需求"><span class="nav-number">2.</span> <span class="nav-text">Windows系统软件需求</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#环境变量配置"><span class="nav-number">2.1.</span> <span class="nav-text">环境变量配置</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#集群环境建设目标"><span class="nav-number">3.</span> <span class="nav-text">集群环境建设目标</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#集群搭建过程"><span class="nav-number">4.</span> <span class="nav-text">集群搭建过程</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#配置Vagrant-Box"><span class="nav-number">4.1.</span> <span class="nav-text">配置Vagrant Box</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#构建自动部署控制机"><span class="nav-number">4.2.</span> <span class="nav-text">构建自动部署控制机</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#准备集群环境"><span class="nav-number">4.3.</span> <span class="nav-text">准备集群环境</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#部署zookeeper-storm等集群"><span class="nav-number">4.4.</span> <span class="nav-text">部署zookeeper/storm等集群</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#验证集群可用性"><span class="nav-number">5.</span> <span class="nav-text">验证集群可用性</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#验证Zookeeper的集群可用性"><span class="nav-number">5.1.</span> <span class="nav-text">验证Zookeeper的集群可用性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#验证Storm集群的可用性"><span class="nav-number">5.2.</span> <span class="nav-text">验证Storm集群的可用性</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#验证Kafka集群的可用性"><span class="nav-number">5.3.</span> <span class="nav-text">验证Kafka集群的可用性</span></a></li></ol></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy;  2015 - 
  <span itemprop="copyrightYear">2017</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">
     
      <a href="mailto:chrisrc@qq.com">chrisrc</a> 
    
  </span>
  <span class="author"> &nbsp; QQ: 58122705 </span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Mist
  </a>
</div>


        

        
      </div>
    </footer>

    <div class="back-to-top">
      <i class="fa fa-arrow-up"></i>
    </div>
  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  



  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.0"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.0"></script>



  
  

  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.0"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.0"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.0"></script>



  

  
    
  

  <script type="text/javascript">
    var duoshuoQuery = {short_name:"chrisrc"};
    (function() {
      var ds = document.createElement('script');
      ds.type = 'text/javascript';ds.async = true;
      ds.id = 'duoshuo-script';
      ds.src = (document.location.protocol == 'https:' ? 'https:' : 'http:') + '//static.duoshuo.com/embed.js';
      ds.charset = 'UTF-8';
      (document.getElementsByTagName('head')[0]
      || document.getElementsByTagName('body')[0]).appendChild(ds);
    })();
  </script>

  
    
    
    <script src="/lib/ua-parser-js/dist/ua-parser.min.js?v=0.7.9"></script>
    <script src="/js/src/hook-duoshuo.js"></script>
  








  
  

  

  

  
<script>
(function(){
    var bp = document.createElement('script');
    var curProtocol = window.location.protocol.split(':')[0];
    if (curProtocol === 'https') {
        bp.src = 'https://zz.bdstatic.com/linksubmit/push.js';        
    }
    else {
        bp.src = 'http://push.zhanzhang.baidu.com/push.js';
    }
    var s = document.getElementsByTagName("script")[0];
    s.parentNode.insertBefore(bp, s);
})();
</script>


  
<script>
(function(){
   var src = (document.location.protocol == "http:") ? "http://js.passport.qihucdn.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04":"https://jspassport.ssl.qhimg.com/11.0.1.js?ed903ab05fbc5fa64d95e4bfbf3d3a04";
   document.write('<script src="' + src + '" id="sozz"><\/script>');
})();
</script>

  


</body>
</html>
